package org.hhchat.others.sogou;

import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

public class eaxm1 {

    static public long fact(long n) {
        if(n==0){
            return 1;
        }
        if (n == 1) {
            return 1;
        }else{
            return fact(n - 1) * n;
        }
    }
    static public long c(long n,long m){
        return fact(m) / (fact(n) * fact(m - n));
    }
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.nextLine());
        double [] rad = new double [n];
        for(int i=0;i<n;i++){
            rad[i] = Double.parseDouble(scan.nextLine());
        }
        if(n<3){
            System.out.println(0);
            return;
        }
        long count = 0;
        for(int i=0;i<n-1;i++) {
            double optrad = rad[i]<180?180.0 + rad[i]:rad[i]-180.0;
            int index = Arrays.binarySearch(rad, optrad);
            if (index < 0) {
                index = -(index + 1);
            }
            if(index<i){
                index += n;
            }
            long m = index - 1 - i;
            if(m<2){
                continue;
            }
            count += c(2, m);
        }
        System.out.println(count);
    }
}
